package c.e.a.b.f.a;

import c.e.a.b.e.c.g;
import c.e.a.b.f.b.z5;

/* compiled from: com.google.android.gms:play-services-measurement-sdk-api@@18.0.0 */
public class a {
    public final g a;

    /* compiled from: com.google.android.gms:play-services-measurement-sdk-api@@18.0.0 */
    public interface a extends z5 {
    }

    public a(g gVar) {
        this.a = gVar;
    }

    /* JADX WARNING: Missing block: B:15:0x003f, code skipped:
            if (r0.h == null) goto L_0x004e;
     */
    /* JADX WARNING: Missing block: B:17:?, code skipped:
            r0.h.registerOnMeasurementEventListener(r2);
     */
    /* JADX WARNING: Missing block: B:18:0x0047, code skipped:
            android.util.Log.w(r0.a, "Failed to register event listener on calling thread. Trying again on the dynamite thread.");
     */
    /* JADX WARNING: Missing block: B:32:?, code skipped:
            return;
     */
    public void a(c.e.a.b.f.a.a.a r6) {
        /*
        r5 = this;
        r0 = r5.a;
        java.util.Objects.requireNonNull(r0);
        r1 = r0.e;
        monitor-enter(r1);
        r2 = 0;
    L_0x0009:
        r3 = r0.e;	 Catch:{ all -> 0x0059 }
        r3 = r3.size();	 Catch:{ all -> 0x0059 }
        if (r2 >= r3) goto L_0x002d;
    L_0x0011:
        r3 = r0.e;	 Catch:{ all -> 0x0059 }
        r3 = r3.get(r2);	 Catch:{ all -> 0x0059 }
        r3 = (android.util.Pair) r3;	 Catch:{ all -> 0x0059 }
        r3 = r3.first;	 Catch:{ all -> 0x0059 }
        r3 = r6.equals(r3);	 Catch:{ all -> 0x0059 }
        if (r3 == 0) goto L_0x002a;
    L_0x0021:
        r6 = r0.a;	 Catch:{ all -> 0x0059 }
        r0 = "OnEventListener already registered.";
        android.util.Log.w(r6, r0);	 Catch:{ all -> 0x0059 }
        monitor-exit(r1);	 Catch:{ all -> 0x0059 }
        goto L_0x0058;
    L_0x002a:
        r2 = r2 + 1;
        goto L_0x0009;
    L_0x002d:
        r2 = new c.e.a.b.e.c.g$c;	 Catch:{ all -> 0x0059 }
        r2.m7970init(r6);	 Catch:{ all -> 0x0059 }
        r3 = r0.e;	 Catch:{ all -> 0x0059 }
        r4 = new android.util.Pair;	 Catch:{ all -> 0x0059 }
        r4.<init>(r6, r2);	 Catch:{ all -> 0x0059 }
        r3.add(r4);	 Catch:{ all -> 0x0059 }
        monitor-exit(r1);	 Catch:{ all -> 0x0059 }
        r6 = r0.h;
        if (r6 == 0) goto L_0x004e;
    L_0x0041:
        r6 = r0.h;	 Catch:{ BadParcelableException | NetworkOnMainThreadException | RemoteException | IllegalArgumentException | IllegalStateException | NullPointerException | SecurityException | UnsupportedOperationException -> 0x0047, BadParcelableException | NetworkOnMainThreadException | RemoteException | IllegalArgumentException | IllegalStateException | NullPointerException | SecurityException | UnsupportedOperationException -> 0x0047, BadParcelableException | NetworkOnMainThreadException | RemoteException | IllegalArgumentException | IllegalStateException | NullPointerException | SecurityException | UnsupportedOperationException -> 0x0047, BadParcelableException | NetworkOnMainThreadException | RemoteException | IllegalArgumentException | IllegalStateException | NullPointerException | SecurityException | UnsupportedOperationException -> 0x0047, BadParcelableException | NetworkOnMainThreadException | RemoteException | IllegalArgumentException | IllegalStateException | NullPointerException | SecurityException | UnsupportedOperationException -> 0x0047, BadParcelableException | NetworkOnMainThreadException | RemoteException | IllegalArgumentException | IllegalStateException | NullPointerException | SecurityException | UnsupportedOperationException -> 0x0047, BadParcelableException | NetworkOnMainThreadException | RemoteException | IllegalArgumentException | IllegalStateException | NullPointerException | SecurityException | UnsupportedOperationException -> 0x0047, BadParcelableException | NetworkOnMainThreadException | RemoteException | IllegalArgumentException | IllegalStateException | NullPointerException | SecurityException | UnsupportedOperationException -> 0x0047 }
        r6.registerOnMeasurementEventListener(r2);	 Catch:{ BadParcelableException | NetworkOnMainThreadException | RemoteException | IllegalArgumentException | IllegalStateException | NullPointerException | SecurityException | UnsupportedOperationException -> 0x0047, BadParcelableException | NetworkOnMainThreadException | RemoteException | IllegalArgumentException | IllegalStateException | NullPointerException | SecurityException | UnsupportedOperationException -> 0x0047, BadParcelableException | NetworkOnMainThreadException | RemoteException | IllegalArgumentException | IllegalStateException | NullPointerException | SecurityException | UnsupportedOperationException -> 0x0047, BadParcelableException | NetworkOnMainThreadException | RemoteException | IllegalArgumentException | IllegalStateException | NullPointerException | SecurityException | UnsupportedOperationException -> 0x0047, BadParcelableException | NetworkOnMainThreadException | RemoteException | IllegalArgumentException | IllegalStateException | NullPointerException | SecurityException | UnsupportedOperationException -> 0x0047, BadParcelableException | NetworkOnMainThreadException | RemoteException | IllegalArgumentException | IllegalStateException | NullPointerException | SecurityException | UnsupportedOperationException -> 0x0047, BadParcelableException | NetworkOnMainThreadException | RemoteException | IllegalArgumentException | IllegalStateException | NullPointerException | SecurityException | UnsupportedOperationException -> 0x0047, BadParcelableException | NetworkOnMainThreadException | RemoteException | IllegalArgumentException | IllegalStateException | NullPointerException | SecurityException | UnsupportedOperationException -> 0x0047 }
        goto L_0x0058;
    L_0x0047:
        r6 = r0.a;
        r1 = "Failed to register event listener on calling thread. Trying again on the dynamite thread.";
        android.util.Log.w(r6, r1);
    L_0x004e:
        r6 = new c.e.a.b.e.c.a0;
        r6.m5513init(r0, r2);
        r0 = r0.c;
        r0.execute(r6);
    L_0x0058:
        return;
    L_0x0059:
        r6 = move-exception;
        monitor-exit(r1);	 Catch:{ all -> 0x0059 }
        throw r6;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.e.a.b.f.a.a.a(c.e.a.b.f.a.a$a):void");
    }
}
